import type { App } from 'vue'
/*
 * @Description: 该文件描述
 * @FilePath: \vue-web-template\src\utils\bootstrap\index.ts
 * @Author: Brian Brian@gmail.com
 * @Date: 2024-10-25 09:58:43
 * @LastEditors: Brian Brian@gmail.com
 * @LastEditTime: 2024-10-25 15:25:46
 */
import router from '@/router'
import { createPinia } from 'pinia'
import { i18n } from '../i18n'
import directives from './directive'
import { addGlobalConfig } from './globalConfig'
import { createComponents } from './plugins'
import provide from './provide'
import 'element-plus/dist/index.css'
import '@/assets/styles/index.scss'
import 'virtual:uno.css'

export async function bootstrap(app: App) {
  document.title = import.meta.env.VITE_TITTLE
  app.use(provide)
  app.use(addGlobalConfig)
  app.use(directives)
  app.use(createPinia())
  app.use(router)
  const i18nPlugin = await i18n()
  app.use(i18nPlugin)

  createComponents(app)
}
